<!DOCTYPE html>
<html>
<head>
  <title>Progprog Books Online Store</title>
  <%= stylesheet_link_tag "application", :media => "all" %>
  <%= javascript_include_tag "application" %>
  <%= csrf_meta_tags %>
</head>
<body id="store">
<div id="banner">
  <%= form_tag store_path, :class => 'locale' do %>
      <%= select_tag 'set_locale', options_for_select(LANGUAGES, I18n.locale.to_s), :onchange => 'this.form.submit()' %>
      <%= submit_tag 'submit' %>
      <%= javascript_tag "$('.locale input').hide()" %>
  <% end %>
  <%= image_tag "logo.png" %>
  <%= @page_title || t('.title') %>
</div>
<div id="columns">
  <div id="side">
    <% if @cart %>
        <%= hidden_div_if(@cart.line_items.empty?, :id => 'cart') do %>
            <%= render @cart %>
        <% end %>
    <% end %>
    <a href="/"><%= t('.home') %></a><br/>
    <a href="/"><%= t('.questions') %></a><br/>
    <a href="/"><%= t('.news') %></a><br/>
    <a href="/"><%= t('.contact') %></a><br/>

    <% if session[:user_id] %>
        <br/>
        <%= link_to 'Orders', orders_path %>
        <br/>
        <%= link_to 'Products', orders_path %>
        <br/>
        <%= link_to 'Users', orders_path %>
        <br/>

    <% end %>

    <div id="time">Date:<%= Time.new.strftime('%A, %B, %Y')%> </div>
  </div>
  <div id="main">
    <%= yield %>
  </div>
</div>

</body>
</html>
